<template>
	<view class="sign">
		<view class="signItem"  :style="cumulateDays.includes(item.id) ?'background: #5f5f5f;border: #C1E3FF 1px solid;':''" v-for="(item,i) in list" :key="i" @click="checkHandel(i)">
			<view class="day" :class="{active: i == index}">{{item.day}}</view>
			<view class="money">
				<view class="icon" :class="{activeFont: i == index}">
					<image src="../static/img/Icon.png" mode=""></image>
				</view>
				<view class="name" :class="{activeFont: i == index}">{{item.num}}{{cumulateDays.includes(item.id)}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			cumulateDays:{
				type:Array,
				default:() => []
			}
		},
		data(){
			return{
				index:0,
				list:[
					{day:'day 1',num:'10',id:1},
					{day:'day 2',num:'15',id:2},
					{day:'day 3',num:'20',id:3},
					{day:'day 4',num:'25',id:4},
					{day:'day 5',num:'30',id:5},
					{day:'day 6',num:'35',id:6},
					{day:'day 7',num:'40',id:7},
					{day:'day 8',num:'45',id:8},
					{day:'day 9',num:'50',id:9},
					{day:'day 10',num:'55',id:10}
				]
			}
		},
		methods:{
			checkHandel(i){
				this.index = i
				console.log(i)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.sign{
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		.active{
			color: #fff;
		}
		.activeFont{
			color: #C1E3FF;
		}
		.activeback{
			background-color: #C1E3FF;
		}
		.activeborder{
			border: #C1E3FF 1px solid;
		}
		.signItem{
			width: calc(23% - 2px);
			height: 74px;
			background: rgba(45, 45, 45, 1);
			border-radius: 10px;
			margin-left:2%;
			margin-top: 6px;
			color: rgba(189, 189, 189, 1);
			.day{
				width: 100%;
				height: 38px;
				line-height: 38px;
				text-align: center;
				font-family: Inter;
				font-size: 15px;
				font-weight: 600;
			}
			.money{
				width: 100%;
				height: 20px;
				display: flex;
				justify-content: center;
				align-items: center;
				.icon{
					width: 20px;
					height: 20px;
					background: #BDBDBD;
					border-radius: 10px;
					display: flex;
					justify-content: center;
					align-items: center;
					image{
						width: 14px;
						height: 14px;
					}
				}
				.name{
					font-family: Inter;
					font-size: 13px;
					font-weight: 700;
					text-align: left;
					margin-left: 5px;
				}
			}
		}
	}
</style>